package jmine.tec.extensions.services.rs;

import java.util.ArrayList;
import java.util.List;

import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;
import org.apache.commons.lang.builder.ToStringBuilder;

/**
 * @author lundberg
 */
public class ServicesPageRS {

    private String name;

    private List<ServiceRS> services = new ArrayList<ServiceRS>();

    /**
     * @return the name
     */
    public String getName() {
        return this.name;
    }

    /**
     * @param name the name to set
     */
    public void setName(String name) {
        this.name = name;
    }

    /**
     * @return the services
     */
    public List<ServiceRS> getServices() {
        return this.services;
    }

    /**
     * @param services the services to set
     */
    public void setServices(List<ServiceRS> services) {
        this.services = services;
    }

    /**
     * {@inheritDoc}
     */

    @Override
    public boolean equals(Object obj) {
        if (!(obj instanceof ServicesPageRS)) {
            return false;
        }
        if (obj == this) {
            return true;
        }
        ServicesPageRS o = (ServicesPageRS) obj;
        EqualsBuilder builder = new EqualsBuilder();
        builder.append(this.name, o.name);
        builder.append(this.services, o.services);
        return builder.isEquals();
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public int hashCode() {
        return new HashCodeBuilder().append(this.name).append(this.services).toHashCode();
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public String toString() {
        return new ToStringBuilder(this).append(this.name).append(this.services).toString();
    }
}
